package com.aoxon.cargo.service;

import android.util.Log;

/**
 * 产生对应service的工厂
 * 
 * @author ZZJ
 */
public class MyServiceFactory {

    public static final String TAG                                 = "MyServiceFactory";

    public static final String ADD_GOODS                           = "AddGoodsService";
    public static final String DELETE_GOODS                        = "DeleteGoodsService";
    public static final String REVAMP_GOODS                        = "RevampGoodsService";

    public static final String NEW_GOODS                           = "NewGoodsService";
    public static final String HOT_GOODS                           = "HotGoodsService";
    public static final String CLICK_GOODS                         = "ClickGoodsService";
    public static final String COLLECT_GOODS                       = "CollectGoodsService";
    public static final String CANCLE_COLLECT_GOODS                = "CancleCollectGoodsService";

    public static final String GOODS_FILTER                        = "GoodsFilterService";
    public static final String SEARCH_GOODS_TIPS                   = "SearchGoodsTipsService";
    public static final String SEARCH_NEW_GOODS                    = "SearchNewGoodsFromTextService";
    public static final String SEARCH_HOT_GOODS                    = "SearchHotGoodsFromTextService";
    public static final String SEARCH_GOODS_FROM_TEXT_AND_SUPPLIER = "SearchGoodsFormTextAndSupplier";

    public static final String SEARCH_SUPPLIER                     = "SearchSupplierService";
    public static final String SEARCH_SUPPLIER_FROM_CITYMARKET     = "SearchSupplierFormCityMarkerService";
    public static final String SEARCH_SUPPLIER_TIPS                = "SearchSupplierTipsService";

    public static final String HOT_SUPPLIER                        = "HotSupplierService";
    public static final String CER_SUPPLIER                        = "CerSupplierService";
    public static final String GOODS_FROM_SUPPLIER                 = "GoodsFromSupplierService";
    public static final String SUPPLIER_INFORMATION                = "SupplierInformationService";
    public static final String COLLECT_SUPPLIER                    = "CollectSupplierService";
    public static final String CANCLE_COLLECT_SUPPLIER             = "CancleCollectSupplierService";
    public static final String CLOSE_SUPPLIER                      = "CloseSupplierService";

    public static final String CERTIFICATION                       = "CertificationService";
    public static final String REVAMP_STORE                        = "RevampStoreService";
    public static final String REVAMP_PASSWORD                     = "RevampPasswordService";

    public static final String SYSTEM_MESSAGE                      = "SystemMessageService";
    public static final String SYSTEM_MESSAGE_DETAIL               = "SystemMessageDetailService";

    public static final String GET_CITY                            = "GetCityService";
    public static final String GET_MARKET                          = "GetMarketService";

    public static final String FORGET_PASSWORD                     = "ForgetPasswordService";
    public static final String REGISTER_SUPPLIER                   = "RegisterSupplierService";
    public static final String SUGGESTION                          = "SuggestionService";
    public static final String SUPPLIER_INDEX                      = "SupplierIndexService";
    public static final String SUPGETCLASSIFY                      = "SupGetClassifyListService";

    public static final String FILE_UPLOAD                         = "FileUpLoadService";
    public static final String RECORDDIAL 						   = "RecordDialService";
    public static final String CLOTHITEMLISTFORSUPPLIERSERVICE	   ="ClothItemListForSupplierService";
    public static final String UPSALESERVICE					   ="UpsaleService";
    public static final String DOWNSALESERVICE					   ="DownsaleService";
    public static final String GETCLOTHNUMBERFORSUPPLIERSERVICE	   ="GetClothNumBerforSupplierService";
    public static final String GETSEARCHCLOTHNUMBERFORSUPPLIERSERVICE ="GetSearchClothNumBerforSupplierService";
    public static final String GETCURVERSIONSERVICE				   ="GetCurVersionService";
    public static final String INSERTRECORDDIALSERVICE			   ="InsertRecordDialService";
    public static final String BITCHINSERTRECORDDIALSERVICE		   ="BitchInsertRecordDialService";
    public static final String GETgRECORDDIALBYSUPIDSERVICE		   ="GetRecordDialbySupidService";

    /**
     * 利用发射生产对应service的工厂方法
     * 
     * @param serviceName
     * @return
     */
    public static MyService getInstance(String serviceName) {

        MyService myService = null;
        String packageName = "com.aoxon.cargo.service."; // service包的路径
        try {
            // 通过完整路径反射实例化一个对应的service对象
            myService = (MyService) Class.forName(packageName + serviceName).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
            Log.i(TAG, "MyServiceFactory ：MyService实例化失败...");
        }
        return myService;
    }

}
